<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods:{
			getSystemInfo(){
				const {
					statusBarHeight,
					platform,
					model
				} = uni.getSystemInfoSync()
				const {
					top,
					height
				} = uni.getMenuButtonBoundingClientRect()
				// 状态栏高度
				uni.setStorageSync('statusBarHeight', statusBarHeight)
				// 胶囊按钮高度 一般是32 如果获取不到就使用32
				uni.setStorageSync('menuButtonHeight', height ? height : 32)
				// 有小黑条的机型
				let models = ["iPhone X", "iPhone XR", "iPhone XS", "iPhone XS Max", "iPhone 11", "iPhone 11 Pro",
					"iPhone 11 Pro Max", "iPhone 12 mini", "iPhone 12", "iPhone 12 Pro", "iPhone 12 Pro Max"
				];
				// 判断胶囊按钮信息是否成功获取
				if (top && top !== 0 && height && height !== 0) {
					const navigationBarHeight = (top - statusBarHeight) * 2 + height;
					// 导航栏高度
					uni.setStorageSync('navigationBarHeight', navigationBarHeight);
				} else {
					uni.setStorageSync('navigationBarHeight', platform === 'android' ? 48 : 40)
				}
				//判断机型
				for (let i = 0; i < models.length; i++) {
					if (models[i] == model) {
						uni.setStorageSync('blackBar', 34);
						return 1
					} else {
						uni.setStorageSync('blackBar', 0);
					}
				}
				
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import url("./static/font/remixicon_online.css");
	/*每个页面公共css */
</style>
